package dto

import "gorm.io/gorm"

func CommitOrRollback(tx *gorm.DB) {
	if err := recover(); err != nil {
		tx.Rollback()
		panic(err)
	}
	tx.Commit()
}
